module.exports = function (grunt) {
    grunt.config('replace.cp', {
        options: {
            patterns: [
                {
                    match: /(<!-- debug only -->)[\s\S]+(<!-- debug only end -->)/g,
                    replacement: '',
                },
                {
                    match: /(<!-- debug only2 -->)[\s\S]+(<!-- debug only end2 -->)/g,
                    replacement: '',
                },
                {
                    match: /(<!-- release PUBLIC_JS release -->)/g,
                    replacement: '<script src="../js/public.min.js"></script>',
                },
                {
                    match: /(<!-- release ADMIN_PC_JS release -->)/g,
                    replacement: '<script src="js/admin.pc.min.js"></script>',
                },
                {
                    match: /(<!-- release ADMIN_GROUP_JS release -->)/g,
                    replacement: '<script src="js/admin.group.min.js"></script>',
                },
                {
                    match: /(<!-- release PC_MAIN_JS release -->)/g,
                    replacement: '<script src="js/pc.main.js"></script>',
                },
            ]
        },
        files: [
            {
                expand: true,
                src: ['build/**/*.html'],
                dest: '',
            }
        ],
    });
};
